<template>
  <div>
    <el-tag
      type="info"
      v-for="(object, index) in objectList"
      :key="index"
      style="margin: 0.5px 3px"
      >{{ object.showColumn }}</el-tag
    >
  </div>
</template>

<script>
import { refColumn } from "@/api/auth.js";
export default {
  props: ["url", "listString", "refColumn", "value"],
  data() {
    return {
      //存放服务器返回的教师名字
      objectList: [],
      isShowTable: true,
    };
  },
  watch: {
    value: {
      handler(value) {
        this.exchangeValue(value);
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    exchangeValue(value) {
      if (value) {
        refColumn(this.url, this.refColumn, "", "", "", value).then((res) => {
          this.objectList = res.data.dataList;
          //this.isShowTable = Object.keys(res.data.title).length > 1;
        });
      } else {
        this.objectList = [];
      }
    },
  },
};
</script>

<style></style>
